package com.junmo.fanbizhidemo.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.junmo.fanbizhidemo.R;

/**
 * Created by huruihua on 2017/11/8.
 */

public class CountdownTextView extends LinearLayout {

    private TextView textView1, textView2, textView3, textView4;
    private String str1, str2, str3, str4;

    public CountdownTextView(Context context) {
        super(context);
        initWidget();
    }

    public CountdownTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater layoutInflater = (LayoutInflater) context.
                getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        layoutInflater.inflate(R.layout.countdown_text_view, this);
        initWidget();
    }

    private void initWidget() {
        textView1 = (TextView) findViewById(R.id.countdown_txt_a);
        textView2 = (TextView) findViewById(R.id.countdown_txt_b);
        textView3 = (TextView) findViewById(R.id.countdown_txt_c);
        textView4 = (TextView) findViewById(R.id.countdown_txt_d);
    }

    public void setText(String text) {

        textView1.setText(text.charAt(0) + "");
        textView2.setText(text.charAt(1) + "");
        textView3.setText(text.charAt(3) + "");
        textView4.setText(text.charAt(4) + "");

    }
}
